#pragma once

#include "ui_gdalrasteriospeed.h"
#include <QThread>
#include <QtWidgets/QTextEdit>
#include <QtWidgets/QWidget>

class GDALRasterIOSpeedWorker : public QObject
{
    Q_OBJECT
public:
    explicit GDALRasterIOSpeedWorker(QObject* parent = Q_NULLPTR);
    ~GDALRasterIOSpeedWorker();
public slots:
    void doGDALRasterIOSpeedTest(QString path);
signals:
    void doGDALRasterIOSpeedTestFinished();
    void doGDALRasterIOSpeedTestMsg(QString Msg);
    void doGDALRasterIOSpeedTestBlockNumber(int number);
};



class GDALRasterIOSpeed : public QTextEdit
{
    Q_OBJECT

public:
    GDALRasterIOSpeed(QWidget* parent = Q_NULLPTR);

    virtual void dragEnterEvent(QDragEnterEvent* event) override;
    virtual void dragMoveEvent(QDragMoveEvent* event) override;
    virtual void dropEvent(QDropEvent* event) override;
public slots:
    void testFinished();
    void updateSpeedTestMsg(QString msg);
    void updateBlockCount(int count);
signals:
    void startSpeedTest(QString path);

private:
    Ui::GDALRasterIOSpeedClass ui;

    QThread speedWorkerThread;
    QString text;
};
